package com.biwin.module.dict.domain.entity;

import com.biwin.module.orm.api.entity.BwBasicEntity;

import javax.persistence.*;

/**
 * TODO
 *
 * @author biwin
 * @since 0.0.1
 */
@Entity
@Table(name = "dictionary",
        indexes = {@Index(name = "unique_code_desc", columnList = "code_desc", unique = true)},
        uniqueConstraints = {@UniqueConstraint(name = "unique_and_type_code", columnNames = {"type", "code"})}
)
@org.hibernate.annotations.Table(appliesTo = "dictionary", comment = "字段表")
public class Dictionary extends BwBasicEntity {

    private static final long serialVersionUID = 4816061220740552066L;
    @Column(name = "name", columnDefinition = "Varchar(60) not null comment '字典名称' ")
    private String name;

    @Column(name = "type", columnDefinition = "varchar(60) not null comment '字段类型' ")
    private String type;

    @Column(name = "code", columnDefinition = "varchar(60) not null comment '字典键值'")
    private String code;

    @Column(name = "code_desc", columnDefinition = "varchar(60) not null comment '字段描述' ")
    private String codeDesc;

    @Column(name = "sort", columnDefinition = "INT not null default 0 comment '排序号' ")
    private Integer sort;

    @Column(name = "enabled", columnDefinition = "BIT(1) NOT NULL DEFAULT B'0' COMMENT '启用字典' ")
    private Boolean enabled;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getCodeDesc() {
        return codeDesc;
    }

    public void setCodeDesc(String codeDesc) {
        this.codeDesc = codeDesc;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public Boolean getEnabled() {
        return enabled;
    }

    public void setEnabled(Boolean enabled) {
        this.enabled = enabled;
    }
}
